home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / NVRAMPlugin.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  3KB  |  115 lines

  1. /*
  2.      File:        NVRAMPlugin.h
  3.  
  4.      Version:    Technology:    
  5.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  6.  
  7.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16. #ifndef __NVRAMPLUGIN__
  17. #define __NVRAMPLUGIN__
  18.  
  19. #ifndef __TYPES__
  20. #include <Types.h>
  21. #endif
  22.  
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26.  
  27. #if PRAGMA_IMPORT_SUPPORTED
  28. #pragma import on
  29. #endif
  30.  
  31. #if PRAGMA_ALIGN_SUPPORTED
  32. #pragma options align=mac68k
  33. #endif
  34.  
  35. #if FOR_SYSTEM8_PREEMPTIVE
  36. /*
  37. ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
  38.     status codes
  39. ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
  40. */
  41.  
  42. enum {
  43.     kNVRAMNoError                = 0,
  44.     kNVRAMTimeout                = 1,
  45.     kNVRAMUnexpectedError        = 2,
  46.     kNVRAMMemoryError            = 3,
  47.     kNVRAMParameterError        = 4,
  48.     kNVRAMDeviceError            = 5,
  49.     kNVRAMUnexpectedDeviceRequest = 6,
  50.     kNVRAMControllerError        = 7,
  51.     kNVRAMConsistencyCheckError    = 8
  52. };
  53.  
  54. /*
  55. ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
  56.     Plugin Calls Provided by the Family
  57. ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
  58. */
  59. extern void NVRAMFamRequestComplete(OSStatus theStatus);
  60.  
  61. /*
  62. ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
  63.     Plugin Calls Provided by the Plugin
  64. ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
  65.  all plugin calls are async
  66.  the plugin starts the i/o and returns immediately
  67.  the plugin ISR calls NVRAMFamRequestComplete() when the i/o is completed
  68. */
  69. typedef OSStatus (*NVRAMPluginInitPtr)(void );
  70. typedef OSStatus (*NVRAMPluginReadPtr)(UInt16 offset, UInt8 *data, UInt16 count);
  71. typedef OSStatus (*NVRAMPluginWritePtr)(UInt16 offset, UInt8 *data, UInt16 count);
  72.  
  73. enum {
  74.     kNVRAMPluginCurrentRevision    = 0x000D11E2
  75. };
  76.  
  77. struct NVRAMPluginVersion {
  78.     UInt32                             major;
  79.     UInt32                             reserved0;
  80.     UInt32                             reserved1;
  81.     UInt32                             reserved2;
  82. };
  83. typedef struct NVRAMPluginVersion NVRAMPluginVersion;
  84.  
  85. struct NVRAMPluginDispatchTable {
  86.     NVRAMPluginVersion                 version;
  87.     NVRAMPluginInitPtr                 Init;
  88.     NVRAMPluginReadPtr                 Read;
  89.     NVRAMPluginWritePtr             Write;
  90. };
  91. typedef struct NVRAMPluginDispatchTable NVRAMPluginDispatchTable;
  92.  
  93. extern OSStatus NVRAMPluginInit(void );
  94.  
  95. extern OSStatus NVRAMPluginRead(UInt16 offset, UInt8 *data, UInt16 count);
  96.  
  97. extern OSStatus NVRAMPluginWrite(UInt16 offset, UInt8 *data, UInt16 count);
  98.  
  99. #endif
  100.  
  101. #if PRAGMA_ALIGN_SUPPORTED
  102. #pragma options align=reset
  103. #endif
  104.  
  105. #if PRAGMA_IMPORT_SUPPORTED
  106. #pragma import off
  107. #endif
  108.  
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112.  
  113. #endif /* __NVRAMPLUGIN__ */
  114.  
  115.